using System;
using System.Runtime.InteropServices;
using System.Security.Permissions;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Security;

namespace PrintList.Features.Main
{
    [Guid("be8475aa-27a0-4abe-87d5-53869efcc4f1")]
    public class MainEventReceiver : SPFeatureReceiver
    {
 
        public override void FeatureDeactivating(SPFeatureReceiverProperties properties)
        {
            //Clean up
            SPSite siteCollection = (SPSite)properties.Feature.Parent;
            SPWeb site = siteCollection.RootWeb;
            SPFolder printListFolder = site.GetFolder("PrintList");
            printListFolder.Delete();
            SPFile masterPage = site.GetFile("/_catalogs/masterpage/Print.master");
            masterPage.Delete();
            site.Dispose();
            siteCollection.Dispose();
        }
    }
}
